﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;
#pragma warning disable 0618
namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for ImgTest and is intended
    ///to contain all ImgTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ImgTest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Img Constructor
        ///</summary>
        [TestMethod()]
        public void ImgConstructorTest() {
            Img target = new Img("src");
            Assert.AreEqual("<img src=\"src\"/>", target.ToString());
        }

        /// <summary>
        ///A test for Align
        ///</summary>
        [TestMethod()]
        public void AlignTest() {
            Img target = new Img("src");
            Nullable<Img.Alignment> expected = Img.Alignment.Bottom;
            Nullable<Img.Alignment> actual;
            target.Align = expected;
            actual = target.Align;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Alt
        ///</summary>
        [TestMethod()]
        public void AltTest() {
            Img target = new Img("src");
            string expected = string.Empty;
            string actual;
            target.Alt = expected;
            actual = target.Alt;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Border
        ///</summary>
        [TestMethod()]
        public void BorderTest() {
            Img target = new Img("src");
            Nullable<int> expected = 1;
            Nullable<int> actual;
            target.Border = expected;
            actual = target.Border;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for CrossOrigin
        ///</summary>
        [TestMethod()]
        public void CrossOriginTest() {
            Img target = new Img("src");
            Nullable<Img.CrossOriginChoices> expected = Img.CrossOriginChoices.Anonymous;
            Nullable<Img.CrossOriginChoices> actual;
            target.CrossOrigin = expected;
            actual = target.CrossOrigin;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for HSpace
        ///</summary>
        [TestMethod()]
        public void HSpaceTest() {
            Img target = new Img("src");
            Nullable<int> expected = 1;
            Nullable<int> actual;
            target.HSpace = expected;
            actual = target.HSpace;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Height
        ///</summary>
        [TestMethod()]
        public void HeightTest() {
            Img target = new Img("src");
            string expected = string.Empty;
            string actual;
            target.Height = expected;
            actual = target.Height;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for IsMap
        ///</summary>
        [TestMethod()]
        public void IsMapTest() {
            Img target = new Img("src");
            bool expected = false;
            bool actual;
            target.IsMap = expected;
            actual = target.IsMap;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for LongDesc
        ///</summary>
        [TestMethod()]
        public void LongDescTest() {
            Img target = new Img("src");
            string expected = string.Empty;
            string actual;
            target.LongDesc = expected;
            actual = target.LongDesc;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Name
        ///</summary>
        [TestMethod()]
        public void NameTest() {
            Img target = new Img("src");
            string expected = string.Empty;
            string actual;
            target.Name = expected;
            actual = target.Name;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Src
        ///</summary>
        [TestMethod()]
        public void SrcTest() {
            Img target = new Img("src");
            string expected = string.Empty;
            string actual;
            target.Src = expected;
            actual = target.Src;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for UseMap
        ///</summary>
        [TestMethod()]
        public void UseMapTest() {
            Img target = new Img("src");
            string expected = string.Empty;
            string actual;
            target.UseMap = expected;
            actual = target.UseMap;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for VSpace
        ///</summary>
        [TestMethod()]
        public void VSpaceTest() {
            Img target = new Img("src");
            Nullable<int> expected = 1;
            Nullable<int> actual;
            target.VSpace = expected;
            actual = target.VSpace;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Width
        ///</summary>
        [TestMethod()]
        public void WidthTest() {
            Img target = new Img("src");
            string expected = string.Empty;
            string actual;
            target.Width = expected;
            actual = target.Width;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ToStringTest() {
            Img i = new Img("src");
            i.Align = Img.Alignment.Bottom;
            i.Alt = "alt";
            i.Border = 1;
            i.CrossOrigin = Img.CrossOriginChoices.Anonymous;
            i.Height = "10%";
            i.HSpace = 1;
            i.IsMap = true;
            i.LongDesc = "longdesc";
            i.Name = "name";
            i.UseMap = "#usemap";
            i.VSpace = 2;
            i.Width = "11%";
            Assert.AreEqual("<img align=\"bottom\" " +
                "alt=\"alt\" " +
                "border=\"1\" " +
                "crossorigin=\"anonymous\" " +
                "height=\"10%\" " +
                "hspace=\"1\" " +
                "ismap=\"ismap\" " +
                "longdesc=\"longdesc\" " +
                "name=\"name\" " +
                "src=\"src\" " +
                "usemap=\"#usemap\" " +
                "vspace=\"2\" " +
                "width=\"11%\"/>", i.ToString());
        }
    }
}
